package com.shanjupay.test.rocketmq.message;

import com.shanjupay.test.rocketmq.model.OrderExt;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Component;

/**
 * @className: ConsumerSimpleObj
 * @Description: TODO
 * @author: Huangjianyun
 * @date: 2021/10/26 15:53
 */
//第二种直接接收自定义消息格式
@Component
@RocketMQMessageListener(topic = "my-topic-obj",consumerGroup = "demo-consumer-group-obj")
public class ConsumerSimpleObj implements RocketMQListener<OrderExt> {

    //监听到队列的里面的自定义的消息格式进行执行onMessage方法消费消息
    @Override
    public void onMessage(OrderExt orderExt) {
        System.out.println(orderExt);
    }
}
